{% set name_match = file['name_match'] > 94.9 %}
{% set phash_match = file['phash_distance'] is not none and file['phash_distance'] <= 8 %}

<p>
    <span><b>Phash Match:</b> {{ bool_to_icon(phash_match) }}</span>
    <br>
    {% if file['phash_distance'] is not none %}
        <span><b>Phash distance:</b> {{ file['phash_distance'] }}</span>
        <br>
    {% endif %}
    {% if file['phash_duration'] is not none %}
        <span><b>Duration Match:</b> {{ bool_to_icon(file['phash_duration']) }}</span>
        <br>
    {% endif %}
</p>
<p>
    <span><b>Site Match:</b> {{ bool_to_icon(file['site_match']) }}</span>
    <br>
    <span><b>File:</b> {{ file['name_parts']['site']|default('', True) }}</span>
    <br>
    <span><b>Found:</b> {{ file['looked_up']['site']|default('', True) }}</span>
    <br>
</p>
<p>
    <span><b>Date Match:</b> {{ bool_to_icon(file['date_match']) }}</span>
    <br>
    <span><b>File:</b> {{ file['name_parts']['date']|default('', True) }}</span>
    <br>
    <span><b>Found:</b> {{ file['looked_up']['date']|default('', True) }}</span>
</p>
<p>
    <span><b>Name Match:</b> {{ bool_to_icon(name_match) }}</span>
    <br>
    <span><b>File:</b> {{ file['name_parts']['name']|default('', True) }}</span>
    <br>
    <span><b>Found:</b> {{ file['looked_up']['name']|default('', True) }}</span>
    <br>
    <span><b>Matched With:</b> {{ file['name'] }}</span>
</p>
